package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFetchInformationDao;
import com.financing.platform.dto.FetchInformationDTO;
import com.financing.platform.util.SqlName;
/**
 * fetch_information  
 * 抓取资讯表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fetchInformationDao")
public class FetchInformationDaoImpl extends BaseDaoImpl implements IFetchInformationDao {


	@Override
	public int insert(FetchInformationDTO fetchInformation) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.FetchInformationSql.insert, fetchInformation);
	}

	@Override
	public void update(FetchInformationDTO fetchInformation) throws SQLException {
		this.sqlMapClient.update(SqlName.FetchInformationSql.update, fetchInformation);
	}

	@Override
	public void updateForce(FetchInformationDTO fetchInformation) throws SQLException {
		this.sqlMapClient.update(SqlName.FetchInformationSql.updateForce, fetchInformation);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FetchInformationSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FetchInformationDTO> queryList(FetchInformationDTO fetchInformation) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FetchInformationSql.queryList, fetchInformation);
	}
	
	@SuppressWarnings("unchecked")
	@Override
	public List<FetchInformationDTO> queryFetchInfoList(FetchInformationDTO fetchInformation) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FetchInformationSql.queryFetchInfoList, fetchInformation);
	}

	@Override
	public int queryListCount(FetchInformationDTO fetchInformation) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FetchInformationSql.queryListCount, fetchInformation);
	}

	@Override
	public FetchInformationDTO loadById(Integer id) throws SQLException {
		return  (FetchInformationDTO)this.sqlMapClient.queryForObject(SqlName.FetchInformationSql.loadById,id);
	}
 	
}
